(function (window) {
  function _Promise(executor) {
    let self = this

    self.data = undefined
    self.callback = []
    self.status = 'pending'

    function resolve() {

    }
    function reject() {

    }

    executor(resolve, reject)
  }

  // 在promise上挂载各种方法
  _Promise.prototype.then = function (onResolved, onRejected) {
  }

  _Promise.prototype.catch = function (onRejected) {

  }

  // 函数对象挂载方法
  _Promise.resolve = function (value) {
    this.status = 'resolved'
    this.data.push({ 'resolve': value })
  }

  _Promise.reject = function (value) {

  }

  _Promise.all = function (value) {

  }

  _Promise.race = function (value) {

  }


  window.myPromise = _Promise
})()